package com.example.test.a20240530;

import java.util.Scanner;

//字符串最后一个单词的长度
public class HJ1 {
    public static void main(String[] args) {
        Scanner a = new Scanner(System.in);
        String s = a.nextLine();
        int len=s.length();
        int i = s.lastIndexOf(" ");
        int i1 = len - 1 - i;
        System.out.println(i1);
    }
}
